var sdkHistory = {
	history: [],
	top: [],
	bottom: [],
	current: function(){
		return this.top;
	},
	next: function( step){
        if( this.history[0] === undefined){
            this.history = [step];
            this.top = step.exec( this.top);
			return this.top;
        }
        if( step.id && this.history[0].id && step.id() === this.history[0].id()) {
           // this.history=this.history.splice(0,1);
           this.history= this.history.unshift();
            this.top= sdkSlice.copy( this.bottom);
            for( var i= this.history.length-1; i>=0; --i){
                this.top=this.history[i].exec( this.top);
            }
            return this.top;
		} else {
            this.history.unshift( step);
			this.top = step.exec( this.top);
			return this.top;
        } 
	},
	base: function( arg){
		this.bottom = arg;
		this.history= [];
		this.top= sdkSlice.copy(arg);
	}
};